//
//  PrizesView.m
//  抽奖页面
//
//  Created by iOS程序员 on 15/12/3.
//  Copyright © 2015年 iOS程序员. All rights reserved.
//

#import "PrizesView.h"
#import "Hong.pch"
@implementation PrizesView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        int numberPerLine = 3;// 每行显示多少个view
        int numberOfLine = 2;// 一共多少行
        
        // 总共循环的次数就是 行数* 每行的个数
        for(int i = 0; i < numberPerLine * numberOfLine; i++)
        {
            // 计算每个view的frame
            CGRect frame = CGRectMake(20*WIDTH + i % numberPerLine * 100 * WIDTH,12 * HEIGH+ i / numberPerLine * 120 * HEIGH,100*WIDTH - 1, 120*HEIGH - 1);
            
            self.ptView = [[PTView alloc] initWithFrame:frame];
//            self.ptView.myLabel.backgroundColor = [UIColor yellowColor];
//            self.ptView.myView.backgroundColor = [UIColor greenColor];
            [self addSubview:self.ptView];

        }

    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
